package com.ruantu.clothing.controller.wxController;

import com.ruantu.clothing.util.wx.WeixinUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Map;

@Controller
@RequestMapping("/wxConfig")
public class GtConfig {
    @Autowired
    private static WeixinUtil weixinUtil;


    @RequestMapping("/gtConfig.do")
    @ResponseBody
    public Map<String, String> gtconfig(String url){
        // 注意 URL 一定要动态获取，不能 hardcode
        Map<String, String> ret = weixinUtil.sign(url);
       /* for (Map.Entry entry : ret.entrySet()) {
            System.out.println(entry.getKey() + ", " + entry.getValue());
        }*/
        return ret;
    }
}